﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Drawing;
using System.Configuration;
using System.Net.NetworkInformation;


namespace TodoSuspensionWeb
{
    public partial class contactoCliente : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        

        

        protected void Button7_Click(object sender, EventArgs e)
        {
            try
            {

                MailMessage correo = new MailMessage();
                correo.From = new MailAddress("pablo.lud@hotmail.com");
                correo.To.Add(txtEmail.Text.Trim());
                correo.Subject = txtNombre.Text;
                correo.Body = "<html><body><i>" + txtMensaje.Text + "</i></body></html>";

                correo.IsBodyHtml = true;

                correo.Priority = MailPriority.Normal;

                SmtpClient smtp = new SmtpClient();
                smtp.Host = "smtp.live.com";
                smtp.Port = 25;

                smtp.Credentials = new System.Net.NetworkCredential("pablo.lud@hotmail.com", "199027xd");

                smtp.EnableSsl = true;

                smtp.Send(correo);

                lblMensajeError.Text = "MENSAJE ENVIADO";

            }
            catch
            {
                lblMensajeError.Text = "ERROR AL INTENTAR ENVIAR EL MENSAJE";
            }
          
        }
    }
}